package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.common.utils.MemberThreadLocal;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 预约信息Controller
 * 
 * @author ruoyi
 */
@RestController
@RequestMapping("/member/orders")
@Api(tags =  "家属端服务相关接口")
public class MemberNursingProjectController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;


    /**
     * 根据id查询项目详情
     * @param id 项目id
     * @return 返回项目详情
     */
    @GetMapping("/project/{id}")
    @ApiOperation("查询服务项目列表")
    public R<NursingProject> getProjects(@PathVariable("id") Long id) {
        NursingProject nursingProject = nursingProjectService.getById(id);
        return R.ok(nursingProject);
    }

    @GetMapping("/project/page")
    @ApiOperation("分页查询项目列表")
    public TableDataInfo getByPage(@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
                                   @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize)
    {
        TableDataInfo tableDataInfo = nursingProjectService.selectPage(pageNum, pageSize);

        return tableDataInfo;
    }

}